package com.supermarket.business.service.impl;


import com.supermarket.business.service.IFileService;
import com.supermarket.common.strategy.FileStrategy;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

@Service
@Slf4j
public class FileServiceImpl implements IFileService {

    @Resource
    private FileStrategy fileStrategy;

    private static final String BUCKET_NAME = "cwqlyk-supermarket";

    @Override
    public String uploadFile(MultipartFile file) {
        //上传文件到
        String url = fileStrategy.uploadFile(file, BUCKET_NAME);

        return url;
    }
}
